package com.itheima.udp;

import java.io.IOException;
import java.net.*;

public class FasongClient {

    public static void main(String[] args) throws IOException {
        //创建发送对象
        DatagramSocket ds = new DatagramSocket();
        //创建数据对象
        String s="你瞅啥";
        byte[] bytes = s.getBytes();
        InetAddress ip = InetAddress.getByName("zhaichaojie");
        int port =8888;
        DatagramPacket dp = new DatagramPacket(bytes,bytes.length,ip,port);
        // 发送
        ds.send(dp);
        //释放资源
        ds.close();


    }
}
